package cn.edu.cug.cs.gtl.oi.ui.menu;

import javax.swing.*;
import java.awt.event.KeyEvent;

public class JMenuCurve extends JMenu {
    JMenu MenuMouseCreateCurveSurface = new JMenu("鼠标创建曲面");
    JMenuItem ItemApertureFreeConvexPolygon = new JMenuItem("无孔凸多边形");
    JMenuItem ItemCircle = new JMenuItem("圆-O_R");
    JMenuItem ItemEllipse = new JMenuItem("椭圆");
    JMenuItem ItemIsoscelesTriangle = new JMenuItem("等腰三角形");
    JMenuItem ItemParallelogram = new JMenuItem("平行四边形");
    JMenuItem ItemRectangle = new JMenuItem("矩形");
    JMenuItem ItemRegularPolygon = new JMenuItem("正多边形");
    JMenu MenuKeyboardCreateCurveSurface = new JMenu("键盘创建曲面");
    JMenuItem ItemKeyboardCircle = new JMenuItem("圆-O_R");
    JMenuItem ItemKeyboardEllipse = new JMenuItem("椭圆");
    JMenuItem ItemKeyboardRectangle = new JMenuItem("矩形");
    JMenuItem ItemSelectPointOrLineInterpolateSurface = new JMenuItem("选中点/线插值成面");
    JMenuItem ItemSelectElement3AngleSubdivision = new JMenuItem("选中图元三角剖分");
    JMenuItem ItemGenerateGridCurve = new JMenuItem("生成格网曲面");
    JMenuItem ItemTwoCloseCoilsToCurve = new JMenuItem("两个封闭线圈成曲面");
    JMenuItem ItemMultipleCloseCoilsToCurve = new JMenuItem("多个封闭线圈成曲面");
    JMenuItem ItemTwoLineGenerate3AngleSurface = new JMenuItem("两条线段生成三角面");
    JMenuItem ItemTwoLineGenerateGridSurface = new JMenuItem("两条线段生成格网面");
    JMenuItem ItemSingleCloseCoilGeneratePlane = new JMenuItem("单个封闭线圈成平面");
    JMenuItem ItemSingleLineCloseGeneratePlane = new JMenuItem("单线条封闭成平面");
    JMenuItem ItemCloseCoilBorderToPoint = new JMenuItem("封闭线圈边界外推至点");
    JMenuItem ItemCloseCoilPinchingOutToLine = new JMenuItem("封闭线圈尖灭到线条");
    JMenuItem ItemCreateVerticalSectionBaseLine = new JMenuItem("根据线条创建垂直剖面");
    JMenuItem ItemLinkPointGenerateCurve = new JMenuItem("连点成曲面");
    JMenuItem ItemAddPoint = new JMenuItem("加点");
    JMenuItem ItemDelPoint = new JMenuItem("删点");
    JMenuItem ItemChamfer = new JMenuItem("倒角");
    JMenuItem ItemScatter = new JMenuItem("散断");
    JMenuItem ItemGridCurveTo3AngleCurve = new JMenuItem("格网曲面->三角网面");
    JMenuItem ItemDecomposeCurveNormalDirection = new JMenuItem("按法线方向分解曲面");
    JMenuItem ItemExtractSurfaceBorder = new JMenuItem("提取面边界");
    JMenuItem ItemExplode = new JMenuItem("炸开");
    JMenuItem ItemCombine = new JMenuItem("组合");
    JMenuItem ItemMerge = new JMenuItem("合并");
    JMenuItem ItemClearAbnormalObj = new JMenuItem("清除异常对象");
    JMenuItem ItemUpdateStrangePolygon = new JMenuItem("修正奇异多边形");
    JMenuItem ItemPolygonIntersectCheck = new JMenuItem("多边形相交检查");

    public JMenuCurve() {
        this.setText("曲面(G)");
        this.setMnemonic(KeyEvent.VK_G);
        init();
    }

    void init() {

        MenuMouseCreateCurveSurface.add(ItemApertureFreeConvexPolygon);
        MenuMouseCreateCurveSurface.addSeparator();

        MenuMouseCreateCurveSurface.add(ItemCircle);

        MenuMouseCreateCurveSurface.add(ItemEllipse);
        MenuMouseCreateCurveSurface.addSeparator();

        MenuMouseCreateCurveSurface.add(ItemIsoscelesTriangle);

        MenuMouseCreateCurveSurface.add(ItemParallelogram);

        MenuMouseCreateCurveSurface.add(ItemRectangle);
        MenuMouseCreateCurveSurface.addSeparator();

        MenuMouseCreateCurveSurface.add(ItemRegularPolygon);

        this.add(MenuMouseCreateCurveSurface);

        MenuKeyboardCreateCurveSurface.add(ItemKeyboardCircle);

        MenuKeyboardCreateCurveSurface.add(ItemKeyboardEllipse);
        MenuKeyboardCreateCurveSurface.addSeparator();

        MenuKeyboardCreateCurveSurface.add(ItemKeyboardRectangle);

        this.add(MenuKeyboardCreateCurveSurface);
        this.addSeparator();

        ItemSelectPointOrLineInterpolateSurface.setEnabled(false);
        this.add(ItemSelectPointOrLineInterpolateSurface);

        this.add(ItemSelectElement3AngleSubdivision);

        this.add(ItemGenerateGridCurve);
        this.addSeparator();

        ItemTwoCloseCoilsToCurve.setEnabled(false);
        this.add(ItemTwoCloseCoilsToCurve);

        ItemMultipleCloseCoilsToCurve.setEnabled(false);
        this.add(ItemMultipleCloseCoilsToCurve);
        this.addSeparator();

        ItemTwoLineGenerate3AngleSurface.setEnabled(false);
        this.add(ItemTwoLineGenerate3AngleSurface);

        this.add(ItemTwoLineGenerateGridSurface);
        this.addSeparator();

        ItemSingleCloseCoilGeneratePlane.setEnabled(false);
        this.add(ItemSingleCloseCoilGeneratePlane);

        this.add(ItemSingleLineCloseGeneratePlane);
        this.addSeparator();

        ItemCloseCoilBorderToPoint.setEnabled(false);
        this.add(ItemCloseCoilBorderToPoint);

        ItemCloseCoilPinchingOutToLine.setEnabled(false);
        this.add(ItemCloseCoilPinchingOutToLine);
        this.addSeparator();

        this.add(ItemCreateVerticalSectionBaseLine);

        this.add(ItemLinkPointGenerateCurve);
        this.addSeparator();

        ItemAddPoint.setEnabled(false);
        this.add(ItemAddPoint);

        ItemDelPoint.setEnabled(false);
        this.add(ItemDelPoint);
        this.addSeparator();

        ItemChamfer.setEnabled(false);
        this.add(ItemChamfer);

        ItemScatter.setEnabled(false);
        this.add(ItemScatter);
        this.addSeparator();

        this.add(ItemGridCurveTo3AngleCurve);

        this.add(ItemDecomposeCurveNormalDirection);
        this.addSeparator();

        ItemExtractSurfaceBorder.setEnabled(false);
        this.add(ItemExtractSurfaceBorder);
        this.addSeparator();

        ItemExplode.setEnabled(false);
        this.add(ItemExplode);

        ItemCombine.setEnabled(false);
        this.add(ItemCombine);

        ItemMerge.setEnabled(false);
        this.add(ItemMerge);
        this.addSeparator();

        this.add(ItemClearAbnormalObj);

        ItemUpdateStrangePolygon.setEnabled(false);
        this.add(ItemUpdateStrangePolygon);

        ItemPolygonIntersectCheck.setEnabled(false);
        this.add(ItemPolygonIntersectCheck);
    }
}
